package com.sunwayworld.dev.util;

import java.util.HashMap;

import com.sunwayworld.dev.util.StringDevUtil;
import com.sunwayworld.dev.config.VmConfig;
import com.sunwayworld.dev.config.XmlConfig;

public class DevConfigUtil {

	private static VmConfig[] vmConfig = null;

	private static HashMap property = new HashMap();

	static {
		if (vmConfig == null) {
			reload();
		}
	}

	private static void reload() {
		XmlConfig xml = new XmlConfig();
		xml.reloadXml("");
		vmConfig = xml.getVmConfigs();
		property = xml.getProperty();
	}

	public static String getProperty(String name) {
		return StringDevUtil.toString(property.get(name));
	}

	public static VmConfig[] getVmConfigs() {
		return vmConfig;
	}

}
